/**
 * 
 */
package br.com.mateusfsilva.truco;

/**
 * @author Mateus
 *
 */
public class Round
{
   private Hand hand;
   private int player;
   private int[] score = {0, 0, 0};
   private int winner = 0; 
   
   public Hand getHand()
   {
      return hand;
   }
   
   public void setHand(Hand hand)
   {
      this.hand = hand;
   }

   public Round()
   {
      
   }
   
   public int getPlayer()
   {
	   return player;
   }
   
   public boolean Finished()
   {
      int p1 = 0;
      int p2 = 0;
      
      for (int i = 0; i < 3; i++)
      {
         if (score[i] == 1)
         {
            p1++;
         }
         else if (score[i] == 2)
         {
            p2++;
         }
      }
      
      if (p1 == 2)
      {
         this.winner = 1;
         return true;
      }
      if (p2 == 2)
      {
    	  this.winner = 2;
         return true;
      }
      
      return false;
   }
}